To enhance system performance, it is helpful to know which modules within a system are responsible, either directly or indirectly, for the most significant consumption of the most critical system resources. Effective systems management depends on knowing how and when system resources are being used. Similarly, a developer hoping to improve system performance should focus his or her efforts on improving the resource consumption characteristics of the modules which consume the largest amount of critical resources.
Performance tools are used to examine the system in order to determine resource consumption as programs execute. For example, a performance tool may identify the most frequently executed modules and instructions in a system, or may identify those modules which allocate the largest amount of memory or perform the most I/O requests. Performance tools may be implemented in hardware or software. Hardware performance tools are usually built into the system. Software performance tools may be built into the system or added at a later point in time.
Performance tools implemented in software are especially useful in systems, such as personal computer systems, that do not contain many, if any, built-in hardware performance tools.
One type of prior art software performance tool, referred to as a trace tool, keeps track of particular sequences of instructions by logging certain events as they occur. For example, a trace tool may log every entry into and every exit from a module, subroutine, method, function, or system component. Alternately, a trace tool may log the requester and amount of memory allocated for each memory allocation request. Typically, a time stamped record is produced for each such event. Pairs of records similar to entry-exit records are also used to trace execution of arbitrary code segments, to record acquiring and releasing locks, starting and completing I/O or data transmission, and for many other events of interest.
A developer or systems manager is typically presented with a "trace" of the results. The trace is often stored as a text file, such as the example trace, showing entries into and exits from modules, depicted in FIG. 1. The trace in FIG. 1 shows that module "C" is the first module entered. Module "C" calls module "A," module "A" calls module "B," and so on.
FIG. 1 depicts a very small piece of a larger trace. Typically, traces are many millions of entries long. Because loops are common in programs, trace files often contain patterns of events repeated many times. The typical text file trace output may be read by a developer or systems manager, and is adequate for gaining an understanding of very small time periods within the trace. However, a text file trace output is too cumbersome to use when attempting to analyze large scale behavior and patterns contained in a trace. Furthermore, the size of the trace is limited by the buffer space allocated to store the trace. Thus, a system may be traced for a limited, and often very short, period of time.
Consequently, it would be desirable to have a system and method for providing trace information to a developer or systems manager in a compact and highly efficient manner. It would also be desirable to provide the trace information in such a way as to facilitate understanding of the system's operation, and highlight opportunities for performance improvement. It would be further desirable to allow a system to be traced for longer periods of time without losing useful performance and behavioral information due to limited buffer space.